package com.vitria.installer.node;

import java.lang.management.ManagementFactory;

import javax.management.MBeanServer;
import javax.management.ObjectName;

import com.vitria.installer.InstallConfig;

public class Main {

    private static final String OBJ_NAME_STR = "com.vitria.installer:type=InstallNode";

    private static final String DEFAULT_INSTALL_DIR = "C:\\Program Files\\Vitria\\M3O";

    public static void main(String[] args) throws Exception {

        MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
        ObjectName mxbeanName = new ObjectName(OBJ_NAME_STR);

        InstallNode node = new InstallNode(new InstallConfig(DEFAULT_INSTALL_DIR));

        mbs.registerMBean(node, mxbeanName);

        System.out.println("Install node start up and listening ...");
        Thread.sleep(Long.MAX_VALUE);
    }
}